﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DIProject.Data
{
    public class DataLayer : DataBase
    {
        public static void ContextAction(Action<DIAptekaDCDataContext> act)
        {
            using (DIAptekaDCDataContext context = new DIAptekaDCDataContext(ConnectionString))
            {
                act(context);
            }
        }
        public static T ContextFun<T>(Func<DIAptekaDCDataContext, T> fun)
        {
            using (DIAptekaDCDataContext context = new DIAptekaDCDataContext(ConnectionString))
            {
                return fun(context);
            }
        }
    }
}
